Packages 2023 Wrapped

r-pkg

A quick look at my R package updates this year.

Author
Published

July 7, 2023

library(tidyverse)
Warning: package 'ggplot2' was built under R version 4.3.2
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(gt)
make_url <- function(x, y, .tb = pkgs) {
  paste0('<a href="', .tb %>% filter(logo %in% x) %>% slice(match(logo, x)) %>% pull(link), '">', y, '</a>')
}
pkgs <- read_csv('pkgs.csv') |> 
  mutate(logo = paste0('../../', logo)) # set to higher level directory
Rows: 23 Columns: 5
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): name, logo, info, status, link

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
counts_lst_yr <- pkgs %>%
  filter(status == 'CRAN') %>%
  pull(name) %>%
  cranlogs::cran_downloads(from = '2023-01-01') %>%
  group_by(package) %>%
  summarize(count = sum(count)) %>%
  rename(name = package) |> 
  arrange(desc(count)) |> 
  left_join(pkgs, by = 'name')

hists <- pkgs |> 
  filter(status == 'CRAN') |> 
  pull(name) |> 
  map(pkgsearch::cran_package_history) |> 
  list_rbind()

hists <- hists |> 
  mutate(
    year = year(date),
    date2 = date(date)
  )
counts_lst_yr  |> 
  select(logo, info, count) |>
  mutate(rank = row_number()) |> 
  gt()  |> 
  text_transform(
    locations = cells_body(columns = logo),
    fn = function(x) {
      make_url(x, y = 
                 local_image(
                   filename = x,
                   height = 100
                 )
      )
    }
  ) |> 
  fmt_number(columns = count, decimals = 0) |> 
  cols_width(
    logo ~ px(100)
  ) 
info count rank
tinytiger: Lightweight Interface to TIGER/Line Shapefiles (with Cory McCartan) 5,337 1
congress: Access the Congress.gov API 4,837 2
redist: Simulation Methods for Legislative Redistricting (with Cory McCartan, Ben Fifield, and Kosuke Imai) 4,740 3
PL94171: Tabulate P.L. 94-171 Redistricting Data Summary Files (with Cory McCartan) 4,481 4
geomander: Geographic Tools for Studying Gerrymandering 3,519 5
censable: Making Census Data More Usable 3,418 6
divseg: Compute Diversity and Segregation Indices 3,348 7
cvap: Citizen Voting Age Population 2,912 8
name: Tools for Working with Names 2,787 9
gptzeror: Identify Text Written by Large Language Models using GPTZero 2,697 10
redistmetrics: Redistricting metrics (with Cory McCartan, Ben Fifield, and Kosuke Imai) 2,666 11
apportion: Apportion Seats 2,289 12
feltr: Access the Felt API 2,172 13
ggredist: Scales, Palettes, and Extensions of ggplot2 for Redistricting (with Cory McCartan) 2,106 14
dots: Dot Density Maps 1,992 15
ppmf: Read Census Privacy Protected Microdata Files 1,941 16
crayons: Color Palettes from Crayon Boxes 1,807 17
jot: Jot Down Notes for Later 1,697 18
bskyr: Interact with Bluesky Social 209 19

Citation

BibTeX citation:
@online{t. kenny2023,
  author = {T. Kenny, Christopher},
  title = {Packages 2023 {Wrapped}},
  date = {2023-07-07},
  url = {https://christophertkenny.com/posts/2023-12-02-package-downloads},
  langid = {en}
}
For attribution, please cite this work as:
T. Kenny, Christopher. 2023. “Packages 2023 Wrapped.” July 7, 2023. https://christophertkenny.com/posts/2023-12-02-package-downloads.